package com.study.demo_controlleradvice.controlleradvice;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName: GlobalDataController
 * @Description:
 * @author: WS
 * @date 2020/12/11
 * @Version: 1.0
 **/
@ControllerAdvice
public class GlobalDataController {
    @ModelAttribute("info")
    public Map<String,Object> mydata(){
        HashMap<String, Object> stringObjectHashMap = new HashMap<>();
        stringObjectHashMap.put("name","com.study.springBoot");
        stringObjectHashMap.put("address"," ws ");
        return stringObjectHashMap;
    }
}
